//  封装经纪管理
import request from '@/utils/request'
// 获取经纪管理
export function getAgentsList() {
  return request({
    url: '/agents'
  })
}

// 获取经纪列表
export const agentsList = (params) => {
  return request.get('/agents', { params })
}

// 获取经纪总数量
export const AgentsNumber = (params) => {
  return request.get('/agents/count', { params })
}

// 模糊搜索经纪
export const SerchAgents = (params) => {
  return request.get('/agents', { params })
}

// 根据id获取经纪
export function GetAgentsById(id) {
  return request({
    url: '/agents/' + id,
    method: 'get'
  })
}
// 新建经纪
export function AddAgents(data) {
  return request({
    url: '/agents',
    method: 'post',
    data
  })
}

// 编辑经纪
export const EditAgents = (data) => {
  return request.put(`/agents/${data.id}`, data)
}

// 删除经纪
export function DeleteAgents(id) {
  return request({
    url: '/agents/' + id,
    method: 'delete'
  })
}
